#include <iostream>
using namespace std;

#ifdef WIN32
#include <Windows.h>
#include <tchar.h>
#define DLLHANDLE HMODULE
#else
#endif

typedef void * (* fuck_malloc) (size_t size);
typedef void (*fuck_free) (void * p);

#define SAFE_TEST_RET_VAL(val, test, ret) if ( (val) == (test) ) { return (ret); }

int main( int argc, char* argv[] )
{
	DLLHANDLE h = ::LoadLibrary(_T("fuck_malloc.dll"));
	SAFE_TEST_RET_VAL(h, 0, 0);
	
	fuck_malloc fm = (fuck_malloc)GetProcAddress(h, "fuck_malloc");
	fuck_free ff = (fuck_free)GetProcAddress(h, "fuck_free");
	SAFE_TEST_RET_VAL(fm, 0, 0);
	SAFE_TEST_RET_VAL(ff, 0, 0);
	
	void * p = fm(12);

	return 0;
}

